import request from '@/utils/request'
import qs from 'qs'

export function orderList(type, orderNo,
    nickname, receiveName, receivePhone, startTime, endTime, index, pageSize) {
    return request({
        url: '/api/order/orderList.do',
        method: 'get',
        params: {
            type, orderNo,
            nickname, receiveName, receivePhone,
            startTime, endTime, index, pageSize
        }
    })
}

export function refundList(type, orderNo,
    nickname, receiveName, receivePhone, startTime, endTime, index, pageSize) {
    return request({
        url: '/api/order/refundOrderList.do',
        method: 'get',
        params: {
            type, orderNo,
            nickname, receiveName, receivePhone,
            startTime, endTime, index, pageSize
        }
    })
}

export function send(orderId, companyId, courierNo) {
    return request({
        url: '/api/order/send.do',
        method: 'get',
        params: { orderId, companyId, courierNo }
    })
}


export function detail(orderId) {
    return request({
        url: '/api/order/detail.do',
        method: 'get',
        params: { orderId }
    })
}

export function courierInfo(orderId) {
    return request({
        url: '/api/order/courierInfo.do',
        method: 'get',
        params: { orderId }
    })
}

export function allCourierCompany() {
    return request({
        url: '/api/order/allCourierCompany.do',
        method: 'get'
    })
}


export function queryComment(orderId) {
    return request({
        url: '/api/order/queryComment.do',
        method: 'get',
        params: { orderId }
    })
}


export function refundDetail(orderId) {
    return request({
        url: '/api/order/refundDetail.do',
        method: 'get',
        params: { orderId }
    })
}

export function handleAgree(orderId) {
    return request({
        url: '/api/order/handleAgree.do',
        method: 'get',
        params: { orderId }
    })
}

export function handleReject(orderId,reason) {
    return request({
        url: '/api/order/handleReject.do',
        method: 'get',
        params: { orderId,reason }
    })
}